﻿using CommunityToolkit.Maui;
using Maui.App.Services;
using Sharpnado.Tabs;

namespace Maui.App;

public static class MauiProgram
{
	public static MauiApp CreateMauiApp()
	{
		var builder = MauiApp.CreateBuilder();
		builder
			.UseMauiApp<App>()
			
			.UseSharpnadoTabs(true,true)
			.ConfigureFonts(fonts =>
			{
				fonts.AddFont("FontAwesome6FreeBrands.otf", "FontAwesomeBrands");
				fonts.AddFont("FontAwesome6FreeRegular.otf", "FontAwesomeRegular");
				fonts.AddFont("FontAwesome6FreeSolid.otf", "FontAwesomeSolid");
				fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
				fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
			})
			.UseMauiCommunityToolkit();
		builder.Services.AddSingleton<INavigationService, NavigationService>();

	  
		builder.Services.AddSingleton<MainViewModel>();
		builder.Services.AddSingleton<LocalizationViewModel>();
		builder.Services.AddTransient<TabMViewModel>();

		builder.Services.AddTransient<LoginViewModel>();
		builder.Services.AddTransient<RegViewModel>();


		builder.Services.AddSingleton<MainPage>();
		
		builder.Services.AddSingleton<LocalizationPage>();

		builder.Services.AddTransient<Login>();
		builder.Services.AddTransient<Reg>();
		ServiceLocator.Instance = builder.Services.BuildServiceProvider();
		return builder.Build();
	}
}
